<script>
	function testTcp() {
		var rows = clientsOnlineList.datagrid('getChecked');
	    if (rows&&rows.length>0){
	    	if(rows.length>1) {
				showMsg('请选择一条操作记录.');
				return;
			}
	    	createFromWindow("TCP回复测试", "rtcs.do?receive&udid="+rows[0].udid, "",
					function(data) {
	    		
					},false,800,600);
	    }else {
	    	showMsg("请选择操作记录.");
	    }
	}
</script>
<div class="easyui-layout" data-options="fit:true">
	<div data-options="region:'center',border:false">
		<table id="clientsOnlineList" data-options="border:false"></table>
		<script type="text/javascript">
			var clientsOnlineList = null;
			$(function() {
				clientsOnlineList = $('#clientsOnlineList');
				clientsOnlineList.datagrid({
					url : 'rtcs.do?loadClients',
					height : 'auto',
					striped : 'false',
					fit : true,
					selectOnCheck : false,
					checkOnSelect : false,
					loadMsg : '数据加载中，请稍等...',
					queryParams : {
						time : new Date().getTime()
					},
					rownumbers : true,
					singleSelect : true,
					idField : 'id',
					remoteSort : false,
					enableHeaderClickMenu : true,
					enableHeaderContextMenu : true,
					enableRowContextMenu : false,
					toolbar : '#onlineclients_search',
					columns : [ [ {
						field : 'id',
						checkbox : true
					}, {
						field : 'ip',
						width : 200,
						title : 'IP地址',
						sortable : true,
					}, {
						field : 'port',
						width : 50,
						title : '端口',
						sortable : true,
					}, {
						field : 'udid',
						width : 200,
						title : 'UDID序列号',
						sortable : true,
					}, {
						field : 'key',
						width : 200,
						title : 'KEY',
						sortable : true,
					}, {
						field : 'latestAccessTime',
						width : 150,
						title : '最新访问时间',
						sortable : true,
					}, {
						field : 'nowDoing',
						width : 150,
						title : '最近操作',
						sortable : true,
					}, ] ],
				});
			});
		</script>
		
		<div id="onlineclients_search">
			<div style="margin-bottom:5px;padding-left:5px;margin-top: 5px;">
				<form id="onlineclientSearchForm">
					<table>
						
					</table>
				</form>
				
			</div>
			<div id="unit_toolbar" style="height: auto">
				<@eu.linkbutton showName="TCP通信测试" shiro="rtcs:client:send" iconCls="icon-add" onclick="testTcp()"/>			
			</div>
		</div>
		
		
	</div>

</div>
</div>